//
//  WatermarkView.m
//  WatermarkCamera
//
//  Created by zhibao on 2023/9/7.
//

#import "WatermarkView.h"
#import "WatermarkCell.h"
#import "WatermarkEditView.h"
#import "UILabel+Normal.h"
@interface WatermarkView ()<UICollectionViewDataSource,UICollectionViewDelegate>{
    NSInteger selectIndex;
    CGFloat _itemWH;
    CGFloat _margin;
}
@property (nonatomic, strong) MYCollectionView *collectionView;
@property (nonatomic, strong) UICollectionViewFlowLayout *layout;
@property(nonatomic,strong)NSArray *dataArray;
@end
@implementation WatermarkView

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if(self){
        selectIndex = 0;
        [self initView];
    }
    return self;
}

-(void)initView{
    UILabel *titleLabel = [[UILabel alloc]init];
    titleLabel.text = LocalizedString(@"水印模版");
    titleLabel.font = MY_SCALE_SemiboldFONT(16);
    titleLabel.textAlignment = NSTextAlignmentCenter;
    [self addSubview:titleLabel];
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.equalTo(self);
        make.top.mas_equalTo(16);
    }];
    
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn setImage:[UIImage imageNamed:@"com_close_qian"] forState:UIControlStateNormal];
    [btn addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithActionBlock:^(id  _Nonnull sender) {
        if(self.closeShuiyinBlock){
            self.closeShuiyinBlock();
        }
        [UIView animateWithDuration:0.3 animations:^{
            self.top = MY_Screen_H;
        } completion:^(BOOL finished) {
            self.hidden = YES;
        }];
    }]];
    
    [self addSubview:btn];
    [btn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(15);
        make.right.mas_equalTo(-15);
    }];
    
    [self configCollectionView];
    _dataArray = @[
        @{@"title":LocalizedString(@"时间打卡"),@"img":@"h_wm_sjdk",@"type":DAKATYPE},
        @{@"title":LocalizedString(@"考勤打卡"),@"img":@"h_wm_kqdk",@"type":KAOQINATYPE},
        @{@"title":LocalizedString(@"工程记录"),@"img":@"h_wm_gcjl",@"type":GONGCHENGTYPE},
        @{@"title":LocalizedString(@"物业管理"),@"img":@"h_wm_wygl",@"type":WUYETYPE},
        @{@"title":LocalizedString(@"值勤巡逻"),@"img":@"h_wm_zqxl",@"type":ZHIQINTYPE},
        @{@"title":LocalizedString(@"快递外卖"),@"img":@"h_wm_kdwm",@"type":KUAIDITYPE},
        @{@"title":LocalizedString(@"日常巡逻"),@"img":@"h_wm_rcxl",@"type":RICHANGTYPE},
        @{@"title":LocalizedString(@"家政服务"),@"img":@"h_wm_jzfw",@"type":JIAZHENGTYPE},
        @{@"title":LocalizedString(@"会议记录"),@"img":@"h_wm_hyjl",@"type":HUIYITYPE},
        @{@"title":LocalizedString(@"房屋验收"),@"img":@"h_wm_fwys",@"type":FANGWUTYPE},
        @{@"title":LocalizedString(@"任务工单"),@"img":@"h_wm_rwgd",@"type":RENWUTYPE},
        @{@"title":LocalizedString(@"外派学习"),@"img":@"h_wm_wpxx",@"type":WAIPAITYPE},
        @{@"title":LocalizedString(@"关爱老人"),@"img":@"h_wm_galr",@"type":GUANAITYPE},
        @{@"title":LocalizedString(@"旅游打卡"),@"img":@"h_wm_lydk",@"type":LVYOUTYPE},
    ];
    [_collectionView reloadData];
}
- (void)configCollectionView {
    // 如不需要长按排序效果，将LxGridViewFlowLayout类改成UICollectionViewFlowLayout即可
    _layout = [[UICollectionViewFlowLayout alloc] init];
    _collectionView = [[MYCollectionView alloc] initWithFrame:CGRectMake(0, 58, self.width, 390 - 58) collectionViewLayout:_layout];
    _collectionView.alwaysBounceVertical = YES;
    _collectionView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0);
    _collectionView.dataSource = self;
    _collectionView.delegate = self;
    _collectionView.keyboardDismissMode = UIScrollViewKeyboardDismissModeOnDrag;
    [self addSubview:_collectionView];
    [_collectionView removeMJRefresh];
    [_collectionView registerClass:[WatermarkCell class] forCellWithReuseIdentifier:@"FLSShopCell"];
    _margin = 15;
    _itemWH = (MY_Screen_W  - 2)/ 2;
    _layout.itemSize = CGSizeMake(_itemWH, 160);
    _layout.minimumInteritemSpacing = 0;
    _layout.minimumLineSpacing = 0;
    [self.collectionView setCollectionViewLayout:_layout];
}
#pragma mark UICollectionView

- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    return _dataArray.count;
}

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    NSDictionary *dic = _dataArray[indexPath.row];
    WatermarkCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"FLSShopCell" forIndexPath:indexPath];
    BOOL flag = YES;
    if(indexPath.row == selectIndex){
        flag = NO;
    }
    [cell update:dic withFlag:flag];
    return cell;
}


#pragma mark - Click Event


- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
    NSDictionary *dic = _dataArray[indexPath.row];
    if(selectIndex == indexPath.row){
        WatermarkEditView * editView = [[WatermarkEditView alloc] initWithType:dic[@"type"]];
        editView.doneEditBlock = ^{
            if(self.returnShuiyinBlock){
                self.returnShuiyinBlock([self getShuiyinView]);
            }
        };
    }else{
        selectIndex = indexPath.row;
        [self.collectionView reloadData];
        if(self.returnShuiyinBlock){
            self.returnShuiyinBlock([self getShuiyinView]);
        }
    }
}

-(UIImage *)getFirstshuiyinView{
    return [self shijiandaka];
}

- (UIImage *)getShuiyinView{
    NSString *type = _dataArray[selectIndex][@"type"];
    if([type isEqualToString:DAKATYPE]){
        return [self shijiandaka];
    }else if([type isEqualToString:KAOQINATYPE]){
        return [self kaoqindaka];
    }else if([type isEqualToString:GONGCHENGTYPE]){
        return [self gongchengjiludaka];
    }else if([type isEqualToString:WUYETYPE]){
        return [self wuyedaka];
    }else if([type isEqualToString:ZHIQINTYPE]){
        return [self xunluozhiqindaka];
    }else if([type isEqualToString:KUAIDITYPE]){
        return [self kuaidiwaimai];
    }else if([type isEqualToString:RICHANGTYPE]){
        return [self richangxunluo];
    }else if([type isEqualToString:JIAZHENGTYPE]){
        return [self jiazhengfuwu];
    }else if([type isEqualToString:HUIYITYPE]){
        return [self huiyijilv];
    }else if([type isEqualToString:FANGWUTYPE]){
        return [self fangwuyanshou];
    }else if([type isEqualToString:RENWUTYPE]){
        return [self renwugongdan];
    }else if([type isEqualToString:WAIPAITYPE]){
        return [self waipaixuexi];
    }else if([type isEqualToString:GUANAITYPE]){
        return [self guanailaoren];
    }else if([type isEqualToString:LVYOUTYPE]){
        return [self lvyoudaka];
    }
    return nil;
}

-(UIImage *)shijiandaka{
    
    UIView *bgView = [UIView new];
    bgView.backgroundColor = MyColorAlpha(@"000000", 0.4);
    bgView.clipsToBounds = YES;
    bgView.layer.cornerRadius = 10;
    [[UIApplication sharedApplication].delegate.window addSubview:bgView];
    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.mas_equalTo(50);
        make.width.mas_equalTo(230);
    }];
    
    UIButton *bgBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    bgBtn.backgroundColor = MyColor(@"#038BFF");
    bgBtn.layer.cornerRadius = 5;
    [bgBtn setTitle:LocalizedString(@"时间打卡") forState:UIControlStateNormal];
    [bgBtn setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
    [bgBtn setImage:[UIImage imageNamed:@"h_time_top"] forState:UIControlStateNormal];
    bgBtn.titleLabel.font = MY_SCALE_SemiboldFONT(18);
    [bgView addSubview:bgBtn];
    [bgBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.mas_equalTo(10);
        make.width.mas_equalTo(120);
        make.height.mas_equalTo(35);
    }];
    [bgBtn setButtonImageAlignmentStyle:WMButtonAlignmentStyleLeft imageAndLabelSpace:5];
    
    UILabel *timeLabel = [[UILabel alloc]init];
    timeLabel.text = [Helper getCurrentTimes:@"HH:mm"];
    timeLabel.font = MY_SCALE_SemiboldFONT(25);
    timeLabel.textColor = UIColor.whiteColor;
    timeLabel.textAlignment = NSTextAlignmentCenter;
    [bgView addSubview:timeLabel];
    [timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(bgBtn.mas_right).offset(5);
        make.right.equalTo(bgView.mas_right).offset(-5);
        make.centerY.equalTo(bgBtn);
    }];
    LocationModel *locationModel = [GetLocation sharedManager].model;
    NSMutableArray *tempArray = [NSMutableArray new];
    NSDictionary *dakaDic = [MYGlobal share].shuiyinDic[DAKATYPE];
    if([dakaDic[@"1time"] intValue] == 1){
        [tempArray addObject:@{@"img":@"h_time_time",@"content":[[MYGlobal share] getdayAndWeek:dakaDic[@"timeType"]]}];
    }
    if([dakaDic[@"2address"] intValue] == 1){
        [tempArray addObject:@{@"img":@"h_time_dizhi",@"content":locationModel.sjdkdd}];
    }
    if([dakaDic[@"3tianqi"] intValue] == 1){
        [tempArray addObject:@{@"img":@"h_time_tianqi",@"content":locationModel.tianqi}];
    }
    if([dakaDic[@"4jingwei"] intValue] == 1){
        [tempArray addObject:@{@"img":@"h_time_jingwei",@"content":locationModel.jw}];
    }
    if([dakaDic[@"5beizhu"] intValue] == 1){
        [tempArray addObject:@{@"img":@"h_time_beizhu",@"content":locationModel.sjdkbz}];
    }
    UIView *tempView;
    for (int i = 0; i < tempArray.count; i++) {
        UILabel *dayLabel = [[UILabel alloc]init];
        dayLabel.text = tempArray[i][@"content"];
        dayLabel.font = MY_SCALE_RegularFONT(14);
        dayLabel.textColor = UIColor.whiteColor;
        dayLabel.numberOfLines = 0;
        dayLabel.lineBreakMode = NSLineBreakByWordWrapping;
        [bgView addSubview:dayLabel];
        [dayLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(32);
            make.right.equalTo(bgView).offset(-10);
            if(tempView){
                make.top.equalTo(tempView.mas_bottom).offset(6);
            }else{
                make.top.equalTo(bgBtn.mas_bottom).offset(20);
            }
            
            if(i == tempArray.count - 1){
                make.bottom.mas_equalTo(-10);
            }
        }];

        UIImageView *timeImgView = [[UIImageView alloc]initWithImage: [UIImage imageNamed:tempArray[i][@"img"]]];
        [bgView addSubview:timeImgView];
        [timeImgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(10);
            make.centerY.equalTo(dayLabel);
        }];
        tempView = dayLabel;
    }
    [bgView layoutIfNeeded];
    
    UIImage *imageRet = [[UIImage alloc]init];
    DLog(@"wwwww====%f  %f",bgView.width,bgView.height);
    UIGraphicsBeginImageContextWithOptions(bgView.size,NO, 0.0);

    [bgView.layer renderInContext:UIGraphicsGetCurrentContext()];

    imageRet =UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();
    [bgView removeFromSuperview];
    return imageRet;
}

-(UIImage *)kaoqindaka{
    
    UIView *bgView = [UIView new];
    bgView.backgroundColor = MyColorAlpha(@"000000", 0.4);
    bgView.layer.cornerRadius = 10;
    bgView.clipsToBounds = YES;
    [[UIApplication sharedApplication].delegate.window addSubview:bgView];
    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.mas_equalTo(50);
        make.width.mas_equalTo(230);
    }];
    
    UIImageView *topImgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"h_shuiyin_kaoqin_logo"]];
    [bgView addSubview:topImgView];
    [topImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.mas_equalTo(10);
        make.right.mas_equalTo(-10);
        make.height.mas_equalTo(35);
    }];
    UILabel *topTitleLabel = [[UILabel alloc]init];
    topTitleLabel.text = LocalizedString(@"考勤打卡");
    topTitleLabel.font = MY_SCALE_SemiboldFONT(18);
    topTitleLabel.textColor = UIColor.whiteColor;
    [topImgView addSubview:topTitleLabel];
    [topTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(36);
        make.centerY.equalTo(topImgView);
    }];
    
    UILabel *timeLabel = [[UILabel alloc]init];
    timeLabel.text = [Helper getCurrentTimes:@"HH:mm"];
    timeLabel.font = MY_SCALE_SemiboldFONT(23);
    timeLabel.textColor = UIColor.blackColor;
    [topImgView addSubview:timeLabel];
    [timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(bgView.mas_right).offset(-20);
        make.centerY.equalTo(topImgView);
    }];
    
    LocationModel *locationModel = [GetLocation sharedManager].model;
    NSMutableArray *tempArray = [NSMutableArray new];
    NSDictionary *dakaDic = [MYGlobal share].shuiyinDic[KAOQINATYPE];
    if([dakaDic[@"1time"] intValue] == 2){
        [tempArray addObject:@{@"title":LocalizedString(@"时间："),@"content":[[MYGlobal share] getdayAndWeek:dakaDic[@"timeType"]]}];
    }
    if([dakaDic[@"2address"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"地点："),@"content":locationModel.kqdkdd}];
    }
    if([dakaDic[@"3tianqi"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"天气："),@"content":locationModel.tianqi}];
    }
    if([dakaDic[@"4jingwei"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"经纬度："),@"content":locationModel.jw}];
    }
    if([dakaDic[@"5beizhu"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"备注："),@"content":locationModel.kqdlbz}];
    }
    UIView *tempView;
    for (int i = 0; i < tempArray.count; i++) {
        UILabel *dayLabel = [[UILabel alloc]init];
        dayLabel.text = tempArray[i][@"content"];
        dayLabel.font = MY_SCALE_RegularFONT(14);
        dayLabel.textColor = UIColor.whiteColor;
        dayLabel.numberOfLines = 0;
        dayLabel.lineBreakMode = NSLineBreakByWordWrapping;
        [bgView addSubview:dayLabel];
        [dayLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(70);
            make.right.equalTo(bgView).offset(-10);
            if(tempView){
                make.top.equalTo(tempView.mas_bottom).offset(6);
            }else{
                make.top.equalTo(topImgView.mas_bottom).offset(20);
            }
            
            if(i == tempArray.count - 1){
                make.bottom.mas_equalTo(-10);
            }
        }];

        UILabel *titleLabel = [[UILabel alloc]init];
        titleLabel.text = tempArray[i][@"title"];
        titleLabel.font = MY_SCALE_RegularFONT(14);
        titleLabel.textColor = UIColor.whiteColor;
        [bgView addSubview:titleLabel];
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(10);
            make.width.mas_equalTo(60);
            make.centerY.equalTo(dayLabel);
        }];
        [titleLabel layoutIfNeeded];
        [titleLabel textAlignmentLeftAndRight];
        tempView = dayLabel;
    }
    [bgView layoutIfNeeded];
    
    UIImage *imageRet = [[UIImage alloc]init];
    DLog(@"wwwww====%f  %f",bgView.width,bgView.height);
    UIGraphicsBeginImageContextWithOptions(bgView.size,NO, 0.0);

    [bgView.layer renderInContext:UIGraphicsGetCurrentContext()];

    imageRet =UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();
    [bgView removeFromSuperview];
    return imageRet;
}

-(UIImage *)gongchengjiludaka{
    
    UIView *bgView = [UIView new];
    bgView.backgroundColor = MyColorAlpha(@"000000", 0.4);
    bgView.layer.cornerRadius = 10;
    bgView.layer.borderColor = MyColor(@"#FABB00").CGColor;
    bgView.layer.borderWidth =2.5;
    bgView.clipsToBounds = YES;
    [[UIApplication sharedApplication].delegate.window addSubview:bgView];
    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.mas_equalTo(50);
        make.width.mas_equalTo(230);
    }];
    
    UIImageView *topImgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"h_shuiyin_gcjl_logo"]];
    [bgView addSubview:topImgView];
    [topImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.right.equalTo(bgView);
        make.height.mas_equalTo(42);
    }];
    UILabel *topTitleLabel = [[UILabel alloc]init];
    topTitleLabel.text = LocalizedString(@"工程记录");
    topTitleLabel.font = MY_SCALE_SemiboldFONT(18);
    topTitleLabel.textColor = UIColor.whiteColor;
    [topImgView addSubview:topTitleLabel];
    [topTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(105);
        make.centerY.equalTo(topImgView);
    }];
    
    UILabel *timeLabel = [[UILabel alloc]init];
    timeLabel.text = [Helper getCurrentTimes:@"HH:mm"];
    timeLabel.font = MY_SCALE_SemiboldFONT(23);
    timeLabel.textColor = UIColor.whiteColor;
    [bgView addSubview:timeLabel];
    [timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(12);
        make.top.mas_equalTo(58);
    }];
    
    UIView *line = [UIView new];
    line.backgroundColor = UIColor.whiteColor;
    [bgView addSubview:line];
    [line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(83);
        make.width.mas_equalTo(1);
        make.height.mas_equalTo(25);
        make.centerY.equalTo(timeLabel);
    }];
    
    LocationModel *locationModel = [GetLocation sharedManager].model;
    
    UILabel *weekLabel = [[UILabel alloc]init];
    weekLabel.text = [NSString stringWithFormat:@"%@\n%@",locationModel.week,locationModel.date];
    weekLabel.font = MY_SCALE_RegularFONT(12);
    weekLabel.textColor = UIColor.whiteColor;
    weekLabel.numberOfLines = 0;
    weekLabel.lineBreakMode = NSLineBreakByWordWrapping;
    [bgView addSubview:weekLabel];
    [weekLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(line).offset(12);
        make.centerY.equalTo(line);
    }];

    NSMutableArray *tempArray = [NSMutableArray new];
    NSDictionary *dakaDic = [MYGlobal share].shuiyinDic[GONGCHENGTYPE];
//    if([dakaDic[@"1time"] intValue] == 2){
//        [tempArray addObject:@{@"title":LocalizedString(@"时间："),@"content":[[MYGlobal share] getdayAndWeek:dakaDic[@"timeType"]]}];
//    }
    if([dakaDic[@"2name"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"项目名称："),@"content":locationModel.gcmz}];
    }
    if([dakaDic[@"3quyu"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"施工区域："),@"content":locationModel.quyu}];
    }
    if([dakaDic[@"4sgnr"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"施工内容："),@"content":locationModel.sgnr}];
    }
    if([dakaDic[@"5sgfzr"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"施工负责人："),@"content":locationModel.sgfzr}];
    }
    if([dakaDic[@"6jlfzr"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"监理负责人："),@"content":locationModel.jlfzr}];
    }
    if([dakaDic[@"7jsdw"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"建设单位："),@"content":locationModel.jsdw}];
    }
    if([dakaDic[@"8jldw"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"监理单位："),@"content":locationModel.jldw}];
    }
    if([dakaDic[@"9sgdw"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"施工单位："),@"content":locationModel.sgdw}];
    }
    if([dakaDic[@"10sjdw"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"设计单位："),@"content":locationModel.sjdw}];
    }
    if([dakaDic[@"11ktdw"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"勘探单位："),@"content":locationModel.ktdw}];
    }
    if([dakaDic[@"12tianqi"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"天气："),@"content":locationModel.tianqi}];
    }
    if([dakaDic[@"13jwd"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"经纬度："),@"content":locationModel.jw}];
    }
    if([dakaDic[@"14beizhu"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"备注："),@"content":locationModel.gcbz}];
    }
    UIView *tempView;
    for (int i = 0; i < tempArray.count; i++) {
        UILabel *dayLabel = [[UILabel alloc]init];
        dayLabel.text = tempArray[i][@"content"];
        dayLabel.font = MY_SCALE_RegularFONT(14);
        dayLabel.textColor = UIColor.whiteColor;
        dayLabel.numberOfLines = 0;
        dayLabel.lineBreakMode = NSLineBreakByWordWrapping;
        [bgView addSubview:dayLabel];
        [dayLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(95);
            make.right.equalTo(bgView).offset(-10);
            if(tempView){
                make.top.equalTo(tempView.mas_bottom).offset(6);
            }else{
                make.top.equalTo(topImgView.mas_bottom).offset(58);
            }
            
            if(i == tempArray.count - 1){
                make.bottom.mas_equalTo(-10);
            }
        }];

        UILabel *titleLabel = [[UILabel alloc]init];
        titleLabel.text = tempArray[i][@"title"];
        titleLabel.font = MY_SCALE_RegularFONT(14);
        titleLabel.textColor = UIColor.whiteColor;
        [bgView addSubview:titleLabel];
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(10);
            make.width.mas_equalTo(90);
            make.centerY.equalTo(dayLabel);
        }];
        [titleLabel layoutIfNeeded];
        [titleLabel textAlignmentLeftAndRight];
        tempView = dayLabel;
    }
    [bgView layoutIfNeeded];
    
    UIImage *imageRet = [[UIImage alloc]init];
    DLog(@"wwwww====%f  %f",bgView.width,bgView.height);
    UIGraphicsBeginImageContextWithOptions(bgView.size,NO, 0.0);

    [bgView.layer renderInContext:UIGraphicsGetCurrentContext()];

    imageRet =UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();
    [bgView removeFromSuperview];
    return imageRet;
}

-(UIImage *)wuyedaka{
    
    UIView *bgView = [UIView new];
    bgView.backgroundColor = MyColorAlpha(@"ffffff", 1);
    bgView.layer.cornerRadius = 10;
    bgView.clipsToBounds = YES;
    [[UIApplication sharedApplication].delegate.window addSubview:bgView];
    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.mas_equalTo(50);
        make.width.mas_equalTo(230);
    }];
    
    UIImageView *topImgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"h_shuiyin_wuye_logo"]];
    [bgView addSubview:topImgView];
    [topImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.equalTo(bgView);
        make.top.mas_equalTo(7.5);
        make.height.mas_equalTo(67);
    }];
    UILabel *topTitleLabel = [[UILabel alloc]init];
    topTitleLabel.text = LocalizedString(@"物业管理");
    topTitleLabel.font = MY_SCALE_SemiboldFONT(18);
    topTitleLabel.textColor = UIColor.whiteColor;
    [topImgView addSubview:topTitleLabel];
    [topTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(21);
        make.centerY.equalTo(topImgView);
    }];
    
    UILabel *timeLabel = [[UILabel alloc]init];
   NSArray *temptimeArray =  @[[NSString stringWithFormat:@"%@\n",[Helper getCurrentQUJIAN]],[Helper getCurrentTimes:@"HH:mm"]];
    [Helper setLabelInfo:@[temptimeArray,
                           @[MYBlock,MYBlock],
                           @[MY_SCALE_SemiboldFONT(15),MY_SCALE_SemiboldFONT(23)],
                         ]
                           withLabel:timeLabel];
    timeLabel.numberOfLines = 0;
    timeLabel.lineBreakMode = NSLineBreakByWordWrapping;
    timeLabel.textAlignment = NSTextAlignmentCenter;
    timeLabel.textColor = UIColor.blackColor;
    [topImgView addSubview:timeLabel];
    [timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(bgView).offset(150);
        make.centerY.equalTo(topImgView);
    }];
    
    LocationModel *locationModel = [GetLocation sharedManager].model;
    NSMutableArray *tempArray = [NSMutableArray new];
    NSDictionary *dakaDic = [MYGlobal share].shuiyinDic[WUYETYPE];
    if([dakaDic[@"1time"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"时间："),@"content":[[MYGlobal share] getdayAndWeek:dakaDic[@"timeType"]]}];
    }
    if([dakaDic[@"2address"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"地点："),@"content":locationModel.wydd}];
    }
    if([dakaDic[@"3tianqi"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"天气："),@"content":locationModel.tianqi}];
    }
    if([dakaDic[@"4jingwei"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"经纬度："),@"content":locationModel.jw}];
    }
    if([dakaDic[@"5beizhu"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"备注："),@"content":locationModel.wybz}];
    }
    UIView *tempView;
    for (int i = 0; i < tempArray.count; i++) {
        UILabel *dayLabel = [[UILabel alloc]init];
        dayLabel.text = tempArray[i][@"content"];
        dayLabel.font = MY_SCALE_RegularFONT(14);
        dayLabel.textColor = MYBlock;
        dayLabel.numberOfLines = 0;
        dayLabel.lineBreakMode = NSLineBreakByWordWrapping;
        [bgView addSubview:dayLabel];
        [dayLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(70);
            make.right.equalTo(bgView).offset(-10);
            if(tempView){
                make.top.equalTo(tempView.mas_bottom).offset(6);
            }else{
                make.top.equalTo(topImgView.mas_bottom).offset(20);
            }
            
            if(i == tempArray.count - 1){
                make.bottom.mas_equalTo(-10);
            }
        }];

        UILabel *titleLabel = [[UILabel alloc]init];
        titleLabel.text = tempArray[i][@"title"];
        titleLabel.font = MY_SCALE_RegularFONT(14);
        titleLabel.textColor = MYBlock;
        [bgView addSubview:titleLabel];
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(10);
            make.width.mas_equalTo(60);
            make.centerY.equalTo(dayLabel);
        }];
        [titleLabel layoutIfNeeded];
        [titleLabel textAlignmentLeftAndRight];
        tempView = dayLabel;
    }
    [bgView layoutIfNeeded];
    
    UIImage *imageRet = [[UIImage alloc]init];
    DLog(@"wwwww====%f  %f",bgView.width,bgView.height);
    UIGraphicsBeginImageContextWithOptions(bgView.size,NO, 0.0);

    [bgView.layer renderInContext:UIGraphicsGetCurrentContext()];

    imageRet =UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();
    [bgView removeFromSuperview];
    return imageRet;
}

-(UIImage *)xunluozhiqindaka{
    
    UIView *bgView = [UIView new];
    bgView.backgroundColor = MyColorAlpha(@"#000B5B", 0.6);
    bgView.layer.cornerRadius = 10;
    bgView.clipsToBounds = YES;
    [[UIApplication sharedApplication].delegate.window addSubview:bgView];
    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.mas_equalTo(50);
        make.width.mas_equalTo(230);
    }];
    
    UIImageView *topImgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"h_shuiyin_zhiqin_logo"]];
    [bgView addSubview:topImgView];
    [topImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.mas_equalTo(10);
        make.right.mas_equalTo(-10);
        make.height.mas_equalTo(42);
    }];
    UILabel *topTitleLabel = [[UILabel alloc]init];
    topTitleLabel.text = LocalizedString(@"执勤巡逻");
    topTitleLabel.font = MY_SCALE_SemiboldFONT(20);
    topTitleLabel.textColor = MYBlock;
    [topImgView addSubview:topTitleLabel];
    [topTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(10);
        make.centerY.equalTo(topImgView);
    }];
    
    UILabel *timeLabel = [[UILabel alloc]init];
    timeLabel.text = [Helper getCurrentTimes:@"HH:mm"];
    timeLabel.font = MY_SCALE_SemiboldFONT(23);
    timeLabel.textColor = UIColor.whiteColor;
    [topImgView addSubview:timeLabel];
    [timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(bgView.mas_right).offset(-22);
        make.centerY.equalTo(topImgView);
    }];
    
    LocationModel *locationModel = [GetLocation sharedManager].model;
    NSMutableArray *tempArray = [NSMutableArray new];
    NSDictionary *dakaDic = [MYGlobal share].shuiyinDic[ZHIQINTYPE];
    if([dakaDic[@"1zxry"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"执勤人员："),@"content":locationModel.zqry}];
    }
    if([dakaDic[@"2time"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"时间："),@"content":[[MYGlobal share] getdayAndWeek:dakaDic[@"timeType"]]}];
    }
    if([dakaDic[@"3address"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"地点："),@"content":locationModel.xldd}];
    }
    if([dakaDic[@"4xlqy"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"巡逻区域："),@"content":locationModel.xlqy}];
    }
    if([dakaDic[@"5xljg"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"巡逻结果："),@"content":locationModel.xljg}];
    }
    if([dakaDic[@"6tfsj"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"突发事件："),@"content":locationModel.tfsj}];
    }
    if([dakaDic[@"7tianqi"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"天气："),@"content":locationModel.tianqi}];
    }
    if([dakaDic[@"8jingwei"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"经纬度："),@"content":locationModel.jw}];
    }
    if([dakaDic[@"9beizhu"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"备注："),@"content":locationModel.xlbz}];
    }
    UIView *tempView;
    for (int i = 0; i < tempArray.count; i++) {
        UILabel *dayLabel = [[UILabel alloc]init];
        dayLabel.text = tempArray[i][@"content"];
        dayLabel.font = MY_SCALE_RegularFONT(14);
        dayLabel.textColor = UIColor.whiteColor;
        dayLabel.numberOfLines = 0;
        dayLabel.lineBreakMode = NSLineBreakByWordWrapping;
        [bgView addSubview:dayLabel];
        [dayLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(90);
            make.right.equalTo(bgView).offset(-10);
            if(tempView){
                make.top.equalTo(tempView.mas_bottom).offset(6);
            }else{
                make.top.equalTo(topImgView.mas_bottom).offset(25);
            }
            
            if(i == tempArray.count - 1){
                make.bottom.mas_equalTo(-10);
            }
        }];

        UILabel *titleLabel = [[UILabel alloc]init];
        titleLabel.text = tempArray[i][@"title"];
        titleLabel.font = MY_SCALE_RegularFONT(14);
        titleLabel.textColor = UIColor.whiteColor;
        [bgView addSubview:titleLabel];
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(10);
            make.width.mas_equalTo(80);
            make.centerY.equalTo(dayLabel);
        }];
        [titleLabel layoutIfNeeded];
        [titleLabel textAlignmentLeftAndRight];
        tempView = dayLabel;
    }
    [bgView layoutIfNeeded];
    
    UIImage *imageRet = [[UIImage alloc]init];
    DLog(@"wwwww====%f  %f",bgView.width,bgView.height);
    UIGraphicsBeginImageContextWithOptions(bgView.size,NO, 0.0);

    [bgView.layer renderInContext:UIGraphicsGetCurrentContext()];

    imageRet =UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();
    [bgView removeFromSuperview];
    return imageRet;
}

-(UIImage *)kuaidiwaimai{
    
    UIView *bgView = [UIView new];
    bgView.backgroundColor = MyColorAlpha(@"000000", 0.4);
    bgView.layer.cornerRadius = 10;
    bgView.clipsToBounds = YES;
    [[UIApplication sharedApplication].delegate.window addSubview:bgView];
    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.mas_equalTo(50);
        make.width.mas_equalTo(230);
    }];
    
    UIImageView *topImgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"h_shuiyin_kuaidi_logo"]];
    [bgView addSubview:topImgView];
    [topImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(10);
        make.left.right.equalTo(bgView);
        make.height.mas_equalTo(40);
    }];
    UILabel *topTitleLabel = [[UILabel alloc]init];
    topTitleLabel.text = LocalizedString(@"快递外卖");
    topTitleLabel.font = MY_SCALE_SemiboldFONT(18);
    topTitleLabel.textColor = UIColor.blackColor;
    [topImgView addSubview:topTitleLabel];
    [topTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(95);
        make.centerY.equalTo(topImgView);
    }];
    
    NSMutableArray *tempArray = [NSMutableArray new];
    NSDictionary *dakaDic = [MYGlobal share].shuiyinDic[KUAIDITYPE];
    LocationModel *locationModel = [GetLocation sharedManager].model;
    if([dakaDic[@"1psr"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"配送人："),@"content":locationModel.psr}];
    }
    if([dakaDic[@"2psnr"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"配送内容："),@"content":locationModel.psnr}];
    }
    if([dakaDic[@"3psdd"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"配送地点："),@"content":locationModel.kddd}];
    }
    if([dakaDic[@"4sjr"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"收件人："),@"content":locationModel.sjr}];
    }
    if([dakaDic[@"5sjrdh"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"收件人电话："),@"content":locationModel.sjrdh}];
    }
    if([dakaDic[@"6jjr"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"寄件人："),@"content":locationModel.jjr}];
    }
    if([dakaDic[@"7jjrdh"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"寄件人电话："),@"content":locationModel.jjrdh}];
    }
    if([dakaDic[@"8kdgs"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"快递公司："),@"content":locationModel.kdgs}];
    }
    if([dakaDic[@"9time"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"时间："),@"content":[[MYGlobal share] getdayAndWeek:dakaDic[@"timeType"]]}];
    }
    if([dakaDic[@"10tianqi"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"天气："),@"content":locationModel.tianqi}];
    }
    if([dakaDic[@"11jingwei"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"经纬度："),@"content":locationModel.jw}];
    }
    if([dakaDic[@"12beizhu"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"备注："),@"content":locationModel.kdbz}];
    }
    UIView *tempView;
    for (int i = 0; i < tempArray.count; i++) {
        UILabel *dayLabel = [[UILabel alloc]init];
        dayLabel.text = tempArray[i][@"content"];
        dayLabel.font = MY_SCALE_RegularFONT(14);
        dayLabel.textColor = UIColor.whiteColor;
        dayLabel.numberOfLines = 0;
        dayLabel.lineBreakMode = NSLineBreakByWordWrapping;
        [bgView addSubview:dayLabel];
        [dayLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(95);
            make.right.equalTo(bgView).offset(-10);
            if(tempView){
                make.top.equalTo(tempView.mas_bottom).offset(6);
            }else{
                make.top.equalTo(topImgView.mas_bottom).offset(20);
            }
            
            if(i == tempArray.count - 1){
                make.bottom.mas_equalTo(-10);
            }
        }];

        UILabel *titleLabel = [[UILabel alloc]init];
        titleLabel.text = tempArray[i][@"title"];
        titleLabel.font = MY_SCALE_RegularFONT(14);
        titleLabel.textColor = UIColor.whiteColor;
        [bgView addSubview:titleLabel];
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(10);
            make.width.mas_equalTo(90);
            make.centerY.equalTo(dayLabel);
        }];
        [titleLabel layoutIfNeeded];
        [titleLabel textAlignmentLeftAndRight];
        tempView = dayLabel;
    }
    [bgView layoutIfNeeded];
    
    UIImage *imageRet = [[UIImage alloc]init];
    DLog(@"wwwww====%f  %f",bgView.width,bgView.height);
    UIGraphicsBeginImageContextWithOptions(bgView.size,NO, 0.0);

    [bgView.layer renderInContext:UIGraphicsGetCurrentContext()];

    imageRet =UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();
    [bgView removeFromSuperview];
    return imageRet;
}

-(UIImage *)richangxunluo{
    
    UIView *bgView = [UIView new];
    bgView.layer.cornerRadius = 10;
    bgView.clipsToBounds = YES;
    bgView.backgroundColor = MyColorAlpha(@"#ffffff", 0.0);
    [[UIApplication sharedApplication].delegate.window addSubview:bgView];
    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.mas_equalTo(50);
        make.width.mas_equalTo(230);
    }];
    
    UIImageView *topImgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"h_shuiyin_rcxj_logo"]];
    [bgView addSubview:topImgView];
    [topImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.right.mas_equalTo(0);
        make.height.mas_equalTo(51.5);
    }];
    
    UIView *tempBgView = [UIView new];
    tempBgView.backgroundColor = UIColor.whiteColor;
    [bgView addSubview:tempBgView];
    [tempBgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.equalTo(bgView);
        make.top.equalTo(topImgView.mas_bottom);
    }];
    
    UILabel *timeLabel = [[UILabel alloc]init];
    timeLabel.text = [Helper getCurrentTimes:@"HH:mm"];
    timeLabel.font = MY_SCALE_SemiboldFONT(23);
    timeLabel.textColor = UIColor.whiteColor;
    [topImgView addSubview:timeLabel];
    [timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(bgView).offset(8);
        make.centerY.equalTo(topImgView);
    }];
    
    UILabel *topTitleLabel = [[UILabel alloc]init];
    topTitleLabel.text = LocalizedString(@"日常巡检");
    topTitleLabel.font = MY_SCALE_SemiboldFONT(23);
    topTitleLabel.textColor = MyColor(@"#073A93");
    [topImgView addSubview:topTitleLabel];
    [topTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-29);
        make.centerY.equalTo(topImgView);
    }];
    
    LocationModel *locationModel = [GetLocation sharedManager].model;
    NSMutableArray *tempArray = [NSMutableArray new];
    NSDictionary *dakaDic = [MYGlobal share].shuiyinDic[RICHANGTYPE];
    if([dakaDic[@"1time"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"时间："),@"content":[[MYGlobal share] getdayAndWeek:dakaDic[@"timeType"]]}];
    }
    if([dakaDic[@"2xjdd"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"巡检地点："),@"content":locationModel.rcdd}];
    }
    if([dakaDic[@"3xjry"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"巡逻人员："),@"content":locationModel.xjry}];
    }
    if([dakaDic[@"4xjnr"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"巡逻内容："),@"content":locationModel.xjnr}];
    }
    if([dakaDic[@"5tianqi"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"天气："),@"content":locationModel.tianqi}];
    }
    if([dakaDic[@"6jingwei"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"经纬度："),@"content":locationModel.jw}];
    }
    if([dakaDic[@"7beizhu"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"备注："),@"content":locationModel.rcbz}];
    }
    UIView *tempView;
    for (int i = 0; i < tempArray.count; i++) {
        UILabel *dayLabel = [[UILabel alloc]init];
        dayLabel.text = tempArray[i][@"content"];
        dayLabel.font = MY_SCALE_RegularFONT(14);
        dayLabel.textColor = UIColor.blackColor;
        dayLabel.numberOfLines = 0;
        dayLabel.lineBreakMode = NSLineBreakByWordWrapping;
        [bgView addSubview:dayLabel];
        [dayLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(90);
            make.right.equalTo(bgView).offset(-10);
            if(tempView){
                make.top.equalTo(tempView.mas_bottom).offset(6);
            }else{
                make.top.equalTo(topImgView.mas_bottom).offset(15.5);
            }
            
            if(i == tempArray.count - 1){
                make.bottom.mas_equalTo(-10);
            }
        }];

        UILabel *titleLabel = [[UILabel alloc]init];
        titleLabel.text = tempArray[i][@"title"];
        titleLabel.font = MY_SCALE_RegularFONT(14);
        titleLabel.textColor = UIColor.blackColor;
        [bgView addSubview:titleLabel];
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(10);
            make.width.mas_equalTo(80);
            make.centerY.equalTo(dayLabel);
        }];
        [titleLabel layoutIfNeeded];
        [titleLabel textAlignmentLeftAndRight];
        tempView = dayLabel;
    }
    [bgView layoutIfNeeded];
    
    UIImage *imageRet = [[UIImage alloc]init];
    DLog(@"wwwww====%f  %f",bgView.width,bgView.height);
    UIGraphicsBeginImageContextWithOptions(bgView.size,NO, 0.0);

    [bgView.layer renderInContext:UIGraphicsGetCurrentContext()];

    imageRet =UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();
    [bgView removeFromSuperview];
    return imageRet;
}

-(UIImage *)jiazhengfuwu{
    
    UIView *bgView = [UIView new];
    bgView.layer.cornerRadius = 10;
    bgView.clipsToBounds = YES;
    bgView.backgroundColor = MyColorAlpha(@"#ffffff", 0.0);
    [[UIApplication sharedApplication].delegate.window addSubview:bgView];
    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.mas_equalTo(50);
        make.width.mas_equalTo(230);
    }];
    
    
    UIView *tempBgView = [UIView new];
    tempBgView.backgroundColor = UIColor.whiteColor;
    [bgView addSubview:tempBgView];
    [tempBgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.equalTo(bgView);
        make.top.equalTo(bgView).offset(26);
    }];
    
    UIImageView *topImgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"h_shuiyin_jiazheng_logo"]];
    [bgView addSubview:topImgView];
    [topImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.right.mas_equalTo(0);
        make.height.mas_equalTo(58);
    }];
    
    UILabel *topTitleLabel = [[UILabel alloc]init];
    topTitleLabel.text = LocalizedString(@"家 政 服 务");
    topTitleLabel.font = MY_SCALE_SemiboldFONT(23);
    topTitleLabel.textColor = UIColor.whiteColor;
    [topImgView addSubview:topTitleLabel];
    [topTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(76);
        make.height.mas_equalTo(32.5);
        make.bottom.equalTo(topImgView);
    }];
    
    LocationModel *locationModel = [GetLocation sharedManager].model;
    NSMutableArray *tempArray = [NSMutableArray new];
    NSDictionary *dakaDic = [MYGlobal share].shuiyinDic[JIAZHENGTYPE];
//    jiazhengDic[@"1time"] = @"1";
//    jiazhengDic[@"2fwdd"] = @"1";
//    jiazhengDic[@"3jzry"] = @"1";
//    jiazhengDic[@"4gznr"] = @"1";
//    jiazhengDic[@"5tianqi"] = @"1";
//    jiazhengDic[@"6jingwei"] = @"0";
//    jiazhengDic[@"7beizhu"] = @"0";
    if([dakaDic[@"1time"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"时间："),@"content":[[MYGlobal share] getdayAndWeek:dakaDic[@"timeType"]]}];
    }
    if([dakaDic[@"2fwdd"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"服务地点："),@"content":locationModel.jzdd}];
    }
    if([dakaDic[@"3jzry"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"家政人员："),@"content":locationModel.jzry}];
    }
    if([dakaDic[@"4gznr"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"工作内容："),@"content":locationModel.gznr}];
    }
    if([dakaDic[@"5tianqi"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"天气："),@"content":locationModel.tianqi}];
    }
    if([dakaDic[@"6jingwei"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"经纬度："),@"content":locationModel.jw}];
    }
    if([dakaDic[@"7beizhu"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"备注："),@"content":locationModel.jzbz}];
    }
    UIView *tempView;
    for (int i = 0; i < tempArray.count; i++) {
        UILabel *dayLabel = [[UILabel alloc]init];
        dayLabel.text = tempArray[i][@"content"];
        dayLabel.font = MY_SCALE_RegularFONT(14);
        dayLabel.textColor = UIColor.blackColor;
        dayLabel.numberOfLines = 0;
        dayLabel.lineBreakMode = NSLineBreakByWordWrapping;
        [bgView addSubview:dayLabel];
        [dayLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(90);
            make.right.equalTo(bgView).offset(-10);
            if(tempView){
                make.top.equalTo(tempView.mas_bottom).offset(6);
            }else{
                make.top.equalTo(topImgView.mas_bottom).offset(15.5);
            }
            
            if(i == tempArray.count - 1){
                make.bottom.mas_equalTo(-10);
            }
        }];

        UILabel *titleLabel = [[UILabel alloc]init];
        titleLabel.text = tempArray[i][@"title"];
        titleLabel.font = MY_SCALE_RegularFONT(14);
        titleLabel.textColor = UIColor.blackColor;
        [bgView addSubview:titleLabel];
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(10);
            make.width.mas_equalTo(80);
            make.centerY.equalTo(dayLabel);
        }];
        [titleLabel layoutIfNeeded];
        [titleLabel textAlignmentLeftAndRight];
        tempView = dayLabel;
    }
    [bgView layoutIfNeeded];
    
    UIImage *imageRet = [[UIImage alloc]init];
    DLog(@"wwwww====%f  %f",bgView.width,bgView.height);
    UIGraphicsBeginImageContextWithOptions(bgView.size,NO, 0.0);

    [bgView.layer renderInContext:UIGraphicsGetCurrentContext()];

    imageRet =UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();
    [bgView removeFromSuperview];
    return imageRet;
}

-(UIImage *)huiyijilv{
    
    UIView *bgView = [UIView new];
    bgView.layer.cornerRadius = 10;
    bgView.clipsToBounds = YES;
    bgView.backgroundColor = MyColorAlpha(@"#ffffff", 0.0);
    [[UIApplication sharedApplication].delegate.window addSubview:bgView];
    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.mas_equalTo(50);
        make.width.mas_equalTo(230);
    }];
    
    UIView *tempBgView = [UIView new];
    tempBgView.backgroundColor = MyColorAlpha(@"#000000", 0.4);
    [bgView addSubview:tempBgView];
    [tempBgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.equalTo(bgView);
        make.top.mas_equalTo(20);
    }];
    
    UIImageView *topImgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"h_shuiyin_hyjy_logo"]];
    [bgView addSubview:topImgView];
    [topImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.right.mas_equalTo(0);
        make.height.mas_equalTo(45);
    }];
    
    UILabel *timeLabel = [[UILabel alloc]init];
    timeLabel.text = [Helper getCurrentTimes:@"HH:mm"];
    timeLabel.font = MY_SCALE_SemiboldFONT(25);
    timeLabel.textColor = UIColor.whiteColor;
    [topImgView addSubview:timeLabel];
    [timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(bgView).offset(11);
        make.centerY.equalTo(topImgView);
    }];
    
    UILabel *topTitleLabel = [[UILabel alloc]init];
    topTitleLabel.text = LocalizedString(@"会议记录");
    topTitleLabel.font = MY_SCALE_SemiboldFONT(23);
    topTitleLabel.textColor = MyColor(@"#ffffff");
    [topImgView addSubview:topTitleLabel];
    [topTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-34);
        make.centerY.equalTo(topImgView);
    }];
    
    LocationModel *locationModel = [GetLocation sharedManager].model;
    NSMutableArray *tempArray = [NSMutableArray new];
    NSDictionary *dakaDic = [MYGlobal share].shuiyinDic[HUIYITYPE];
//    hyjyDic[@"1time"] = @"1";
//    hyjyDic[@"2hyjy"] = @"1";
//    hyjyDic[@"3hyrs"] = @"1";
//    hyjyDic[@"4hynr"] = @"1";
//    hyjyDic[@"5hydd"] = @"1";
//    hyjyDic[@"6zcr"] = @"0";
//    hyjyDic[@"7yhry"] = @"0";
//    hyjyDic[@"8tianqin"] = @"1";
//    hyjyDic[@"9jingwei"] = @"0";
//    hyjyDic[@"10beizhu"] = @"0";
    if([dakaDic[@"1time"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"时间："),@"content":[[MYGlobal share] getdayAndWeek:dakaDic[@"timeType"]]}];
    }
    if([dakaDic[@"2hymc"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"会议名称："),@"content":locationModel.hymc}];
    }
    if([dakaDic[@"3hyrs"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"会议人数："),@"content":locationModel.hyrs}];
    }
    if([dakaDic[@"4hynr"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"会议内容："),@"content":locationModel.hynr}];
    }
    if([dakaDic[@"5hydd"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"会议地点："),@"content":locationModel.hydd}];
    }
    if([dakaDic[@"6zcr"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"主持人："),@"content":locationModel.zcr}];
    }
    if([dakaDic[@"7yhry"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"与会人员："),@"content":locationModel.yhry}];
    }
    DLog(@"8tianqi==%d",[dakaDic[@"8tianqi"] intValue]);
    if([dakaDic[@"8tianqi"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"天气："),@"content":locationModel.tianqi}];
    }
    if([dakaDic[@"9jingwei"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"经纬度："),@"content":locationModel.jw}];
    }
    if([dakaDic[@"10beizhu"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"备注："),@"content":locationModel.hyjybz}];
    }
    UIView *tempView;
    for (int i = 0; i < tempArray.count; i++) {
        UILabel *dayLabel = [[UILabel alloc]init];
        dayLabel.text = tempArray[i][@"content"];
        dayLabel.font = MY_SCALE_RegularFONT(14);
        dayLabel.textColor = UIColor.whiteColor;
        dayLabel.numberOfLines = 0;
        dayLabel.lineBreakMode = NSLineBreakByWordWrapping;
        [bgView addSubview:dayLabel];
        [dayLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(90);
            make.right.equalTo(bgView).offset(-10);
            if(tempView){
                make.top.equalTo(tempView.mas_bottom).offset(6);
            }else{
                make.top.equalTo(topImgView.mas_bottom).offset(15.5);
            }
            
            if(i == tempArray.count - 1){
                make.bottom.mas_equalTo(-10);
            }
        }];

        UILabel *titleLabel = [[UILabel alloc]init];
        titleLabel.text = tempArray[i][@"title"];
        titleLabel.font = MY_SCALE_RegularFONT(14);
        titleLabel.textColor = UIColor.whiteColor;
        [bgView addSubview:titleLabel];
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(10);
            make.width.mas_equalTo(80);
            make.centerY.equalTo(dayLabel);
        }];
        [titleLabel layoutIfNeeded];
        [titleLabel textAlignmentLeftAndRight];
        tempView = dayLabel;
    }
    [bgView layoutIfNeeded];
    
    UIImage *imageRet = [[UIImage alloc]init];
    DLog(@"wwwww====%f  %f",bgView.width,bgView.height);
    UIGraphicsBeginImageContextWithOptions(bgView.size,NO, 0.0);

    [bgView.layer renderInContext:UIGraphicsGetCurrentContext()];

    imageRet =UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();
    [bgView removeFromSuperview];
    return imageRet;
}

-(UIImage *)fangwuyanshou{
    
    UIView *bgView = [UIView new];
    bgView.layer.cornerRadius = 10;
    bgView.clipsToBounds = YES;
    bgView.backgroundColor = MyColorAlpha(@"#ffffff", 0.0);
    [[UIApplication sharedApplication].delegate.window addSubview:bgView];
    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.mas_equalTo(50);
        make.width.mas_equalTo(230);
    }];
    
    
    UIView *tempBgView = [UIView new];
    tempBgView.backgroundColor = MyColorAlpha(@"#000000", 0.4);
    [bgView addSubview:tempBgView];
    [tempBgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.equalTo(bgView);
        make.top.equalTo(bgView).offset(26);
    }];
    
    UIImageView *topImgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"h_shuiyin_fwys_logo"]];
    [bgView addSubview:topImgView];
    [topImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.right.mas_equalTo(0);
        make.height.mas_equalTo(50);
    }];
    
    UILabel *topTitleLabel = [[UILabel alloc]init];
    topTitleLabel.text = LocalizedString(@"房 屋 验 收 记 录");
    topTitleLabel.font = MY_SCALE_SemiboldFONT(18);
    topTitleLabel.textColor = UIColor.whiteColor;
    [topImgView addSubview:topTitleLabel];
    [topTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(75);
        make.height.mas_equalTo(32.5);
        make.bottom.equalTo(topImgView);
    }];
    
    LocationModel *locationModel = [GetLocation sharedManager].model;
    NSMutableArray *tempArray = [NSMutableArray new];
    NSDictionary *dakaDic = [MYGlobal share].shuiyinDic[FANGWUTYPE];
//    fwysDic[@"1dkr"] = @"1";
//    fwysDic[@"2khmc"] = @"1";
//    fwysDic[@"3time"] = @"1";
//    fwysDic[@"4dd"] = @"1";
//    fwysDic[@"5tianqi"] = @"1";
//    fwysDic[@"6jwd"] = @"0";
//    fwysDic[@"7beizhu"] = @"0";
    if([dakaDic[@"1dkr"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"带看人："),@"content":locationModel.dkr}];
    }
    if([dakaDic[@"2khmc"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"客户名称："),@"content":locationModel.khmc}];
    }
    if([dakaDic[@"3time"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"时间："),@"content":[[MYGlobal share] getdayAndWeek:dakaDic[@"timeType"]]}];
    }
    if([dakaDic[@"4dd"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"地点："),@"content":locationModel.fwdd}];
    }
    if([dakaDic[@"5tianqi"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"天气："),@"content":locationModel.tianqi}];
    }
    if([dakaDic[@"6jwd"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"经纬度："),@"content":locationModel.jw}];
    }
    if([dakaDic[@"7beizhu"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"备注："),@"content":locationModel.fwyzbz}];
    }
    UIView *tempView;
    for (int i = 0; i < tempArray.count; i++) {
        UILabel *dayLabel = [[UILabel alloc]init];
        dayLabel.text = tempArray[i][@"content"];
        dayLabel.font = MY_SCALE_RegularFONT(14);
        dayLabel.textColor = UIColor.whiteColor;
        dayLabel.numberOfLines = 0;
        dayLabel.lineBreakMode = NSLineBreakByWordWrapping;
        [bgView addSubview:dayLabel];
        [dayLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(90);
            make.right.equalTo(bgView).offset(-10);
            if(tempView){
                make.top.equalTo(tempView.mas_bottom).offset(6);
            }else{
                make.top.equalTo(topImgView.mas_bottom).offset(15);
            }
            
            if(i == tempArray.count - 1){
                make.bottom.mas_equalTo(-10);
            }
        }];

        UILabel *titleLabel = [[UILabel alloc]init];
        titleLabel.text = tempArray[i][@"title"];
        titleLabel.font = MY_SCALE_RegularFONT(14);
        titleLabel.textColor = UIColor.whiteColor;
        [bgView addSubview:titleLabel];
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(10);
            make.width.mas_equalTo(80);
            make.centerY.equalTo(dayLabel);
        }];
        [titleLabel layoutIfNeeded];
        [titleLabel textAlignmentLeftAndRight];
        tempView = dayLabel;
    }
    [bgView layoutIfNeeded];
    
    UIImage *imageRet = [[UIImage alloc]init];
    DLog(@"wwwww====%f  %f",bgView.width,bgView.height);
    UIGraphicsBeginImageContextWithOptions(bgView.size,NO, 0.0);

    [bgView.layer renderInContext:UIGraphicsGetCurrentContext()];

    imageRet =UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();
    [bgView removeFromSuperview];
    return imageRet;
}

-(UIImage *)renwugongdan{
    
    UIView *bgView = [UIView new];
    bgView.layer.cornerRadius = 10;
    bgView.clipsToBounds = YES;
    bgView.backgroundColor = MyColorAlpha(@"#ffffff", 0.0);
    [[UIApplication sharedApplication].delegate.window addSubview:bgView];
    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.mas_equalTo(50);
        make.width.mas_equalTo(230);
    }];
    
    
    UIView *tempBgView = [UIView new];
    tempBgView.backgroundColor = MyColorAlpha(@"#3D70FF", 0.4);
    [bgView addSubview:tempBgView];
    [tempBgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.equalTo(bgView);
        make.top.equalTo(bgView).offset(26);
    }];
    
    UIImageView *topImgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"h_shuiyin_rwgd_logo"]];
    [bgView addSubview:topImgView];
    [topImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.right.mas_equalTo(0);
        make.height.mas_equalTo(43);
    }];
    
    UILabel *topTitleLabel = [[UILabel alloc]init];
    topTitleLabel.text = LocalizedString(@"任 务 工 单");
    topTitleLabel.font = MY_SCALE_SemiboldFONT(23);
    topTitleLabel.textColor = UIColor.whiteColor;
    [topImgView addSubview:topTitleLabel];
    [topTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(73);
        make.height.mas_equalTo(32.5);
        make.bottom.equalTo(topImgView).offset(-3);
    }];
    
    LocationModel *locationModel = [GetLocation sharedManager].model;
    NSMutableArray *tempArray = [NSMutableArray new];
    NSDictionary *dakaDic = [MYGlobal share].shuiyinDic[RENWUTYPE];
//    rwgdDic[@"1jdr"] = @"1";
//    rwgdDic[@"2gcxm"] = @"1";
//    rwgdDic[@"3khmc"] = @"1";
//    rwgdDic[@"4lxfs"] = @"1";
//    rwgdDic[@"5dd"] = @"1";
//    rwgdDic[@"6time"] = @"1";
//    rwgdDic[@"7tianqi"] = @"1";
//    rwgdDic[@"8jwd"] = @"0";
//    rwgdDic[@"9beizhu"] = @"0";
    if([dakaDic[@"1jdr"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"接单人："),@"content":locationModel.jdr}];
    }
    if([dakaDic[@"2gcxm"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"工程项目："),@"content":locationModel.gcxm}];
    }
    if([dakaDic[@"3khmc"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"客户名称："),@"content":locationModel.rwkhmc}];
    }
    if([dakaDic[@"4lxfs"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"联系方式："),@"content":locationModel.lxfs}];
    }
    if([dakaDic[@"5dd"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"地点："),@"content":locationModel.rwdd}];
    }
    if([dakaDic[@"6time"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"时间："),@"content":[[MYGlobal share] getdayAndWeek:dakaDic[@"timeType"]]}];
    }
    if([dakaDic[@"7tianqi"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"天气："),@"content":locationModel.tianqi}];
    }
    if([dakaDic[@"8jwd"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"经纬度："),@"content":locationModel.jw}];
    }
    if([dakaDic[@"9beizhu"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"备注："),@"content":locationModel.rwbz}];
    }
    UIView *tempView;
    for (int i = 0; i < tempArray.count; i++) {
        UILabel *dayLabel = [[UILabel alloc]init];
        dayLabel.text = tempArray[i][@"content"];
        dayLabel.font = MY_SCALE_RegularFONT(14);
        dayLabel.textColor = UIColor.whiteColor;
        dayLabel.numberOfLines = 0;
        dayLabel.lineBreakMode = NSLineBreakByWordWrapping;
        [bgView addSubview:dayLabel];
        [dayLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(90);
            make.right.equalTo(bgView).offset(-10);
            if(tempView){
                make.top.equalTo(tempView.mas_bottom).offset(6);
            }else{
                make.top.equalTo(topImgView.mas_bottom).offset(15);
            }
            
            if(i == tempArray.count - 1){
                make.bottom.mas_equalTo(-10);
            }
        }];

        UILabel *titleLabel = [[UILabel alloc]init];
        titleLabel.text = tempArray[i][@"title"];
        titleLabel.font = MY_SCALE_RegularFONT(14);
        titleLabel.textColor = UIColor.whiteColor;
        [bgView addSubview:titleLabel];
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(10);
            make.width.mas_equalTo(80);
            make.centerY.equalTo(dayLabel);
        }];
        [titleLabel layoutIfNeeded];
        [titleLabel textAlignmentLeftAndRight];
        tempView = dayLabel;
    }
    [bgView layoutIfNeeded];
    
    UIImage *imageRet = [[UIImage alloc]init];
    DLog(@"wwwww====%f  %f",bgView.width,bgView.height);
    UIGraphicsBeginImageContextWithOptions(bgView.size,NO, 0.0);

    [bgView.layer renderInContext:UIGraphicsGetCurrentContext()];

    imageRet =UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();
    [bgView removeFromSuperview];
    return imageRet;
}

-(UIImage *)waipaixuexi{
    
    UIView *bgView = [UIView new];
    bgView.layer.cornerRadius = 10;
    bgView.clipsToBounds = YES;
    bgView.backgroundColor = MyColorAlpha(@"#006460", 0.7);
    bgView.layer.cornerRadius = 10;
    [[UIApplication sharedApplication].delegate.window addSubview:bgView];
    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.mas_equalTo(50);
        make.width.mas_equalTo(230);
    }];
    
    UIImageView *topImgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"h_shuiyin_wpxx_logo"]];
    [bgView addSubview:topImgView];
    [topImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.mas_equalTo(10);
        make.right.mas_equalTo(-10);
        make.height.mas_equalTo(42);
    }];
    UILabel *topTitleLabel = [[UILabel alloc]init];
    topTitleLabel.text = LocalizedString(@"外派学习培训");
    topTitleLabel.font = MY_SCALE_SemiboldFONT(18);
    topTitleLabel.textColor = UIColor.whiteColor;
    [topImgView addSubview:topTitleLabel];
    [topTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(9);
        make.centerY.equalTo(topImgView);
    }];
    
    UILabel *timeLabel = [[UILabel alloc]init];
    timeLabel.text = [Helper getCurrentTimes:@"HH:mm"];
    timeLabel.font = MY_SCALE_SemiboldFONT(23);
    timeLabel.textColor = UIColor.whiteColor;
    [topImgView addSubview:timeLabel];
    [timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(topImgView.mas_right).offset(-13);
        make.centerY.equalTo(topImgView);
    }];
    
    LocationModel *locationModel = [GetLocation sharedManager].model;
    NSMutableArray *tempArray = [NSMutableArray new];
    NSDictionary *dakaDic = [MYGlobal share].shuiyinDic[WAIPAITYPE];
    
//    wpxxDic[@"1wpry"] = @"0";
//    wpxxDic[@"2wpdd"] = @"0";
//    wpxxDic[@"3wpnr"] = @"0";
//    wpxxDic[@"4time"] = @"1";
//    wpxxDic[@"5dd"] = @"1";
//    wpxxDic[@"6tianqi"] = @"1";
//    wpxxDic[@"7jwd"] = @"1";
//    wpxxDic[@"8beizhu"] = @"0";
    if([dakaDic[@"1wpry"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"外派人员："),@"content":locationModel.wpry}];
    }
    if([dakaDic[@"2wpdd"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"外派地点："),@"content":locationModel.wpdd}];
    }
    if([dakaDic[@"3wpnr"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"外派内容："),@"content":locationModel.wpnr}];
    }
    if([dakaDic[@"4time"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"时间："),@"content":[[MYGlobal share] getdayAndWeek:dakaDic[@"timeType"]]}];
    }
    if([dakaDic[@"5dd"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"地点："),@"content":locationModel.wpdd}];
    }
    if([dakaDic[@"6tianqi"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"天气："),@"content":locationModel.tianqi}];
    }
    if([dakaDic[@"7jwd"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"经纬度："),@"content":locationModel.jw}];
    }
    if([dakaDic[@"8beizhu"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"备注："),@"content":locationModel.wpbz}];
    }
    UIView *tempView;
    for (int i = 0; i < tempArray.count; i++) {
        UILabel *dayLabel = [[UILabel alloc]init];
        dayLabel.text = tempArray[i][@"content"];
        dayLabel.font = MY_SCALE_RegularFONT(14);
        dayLabel.textColor = UIColor.whiteColor;
        dayLabel.numberOfLines = 0;
        dayLabel.lineBreakMode = NSLineBreakByWordWrapping;
        [bgView addSubview:dayLabel];
        [dayLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(90);
            make.right.equalTo(bgView).offset(-10);
            if(tempView){
                make.top.equalTo(tempView.mas_bottom).offset(6);
            }else{
                make.top.equalTo(topImgView.mas_bottom).offset(11);
            }
            
            if(i == tempArray.count - 1){
                make.bottom.mas_equalTo(-10);
            }
        }];

        UILabel *titleLabel = [[UILabel alloc]init];
        titleLabel.text = tempArray[i][@"title"];
        titleLabel.font = MY_SCALE_RegularFONT(14);
        titleLabel.textColor = UIColor.whiteColor;
        [bgView addSubview:titleLabel];
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(10);
            make.width.mas_equalTo(80);
            make.centerY.equalTo(dayLabel);
        }];
        [titleLabel layoutIfNeeded];
        [titleLabel textAlignmentLeftAndRight];
        tempView = dayLabel;
    }
    [bgView layoutIfNeeded];
    
    UIImage *imageRet = [[UIImage alloc]init];
    DLog(@"wwwww====%f  %f",bgView.width,bgView.height);
    UIGraphicsBeginImageContextWithOptions(bgView.size,NO, 0.0);

    [bgView.layer renderInContext:UIGraphicsGetCurrentContext()];

    imageRet =UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();
    [bgView removeFromSuperview];
    return imageRet;
}

-(UIImage *)guanailaoren{
    
    UIView *bgView = [UIView new];
    bgView.layer.cornerRadius = 10;
    bgView.clipsToBounds = YES;
    bgView.backgroundColor = UIColor.whiteColor;
    [[UIApplication sharedApplication].delegate.window addSubview:bgView];
    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.mas_equalTo(50);
        make.width.mas_equalTo(230);
    }];
    
    UIImageView *topImgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"h_shuiyin_galr_logo"]];
    [bgView addSubview:topImgView];
    [topImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.right.equalTo(bgView);
        make.height.mas_equalTo(56);
    }];
    UILabel *topTitleLabel = [[UILabel alloc]init];
    topTitleLabel.text = LocalizedString(@"关爱老人");
    topTitleLabel.font = MY_SCALE_SemiboldFONT(23);
    topTitleLabel.textColor = UIColor.whiteColor;
    [topImgView addSubview:topTitleLabel];
    [topTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(9);
        make.centerY.equalTo(topImgView);
    }];
    
    UILabel *timeLabel = [[UILabel alloc]init];
    timeLabel.text = [Helper getCurrentTimes:@"HH:mm"];
    timeLabel.font = MY_SCALE_SemiboldFONT(25);
    timeLabel.textColor = UIColor.blackColor;
    [topImgView addSubview:timeLabel];
    [timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(bgView).offset(-18);
        make.centerY.equalTo(topImgView).offset(-4);
    }];
    
    LocationModel *locationModel = [GetLocation sharedManager].model;
    NSMutableArray *tempArray = [NSMutableArray new];
    NSDictionary *dakaDic = [MYGlobal share].shuiyinDic[GUANAITYPE];
    
//    galrDic[@"1gzxm"] = @"1";
//    galrDic[@"2hgxm"] = @"1";
//    galrDic[@"3lxfs"] = @"0";
//    galrDic[@"4time"] = @"1";
//    galrDic[@"5dd"] = @"1";
//    galrDic[@"6tianqi"] = @"1";
//    galrDic[@"7jwd"] = @"1";
//    galrDic[@"8beizhu"] = @"0";
    if([dakaDic[@"1gzxm"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"雇主姓名："),@"content":locationModel.gzxm}];
    }
    if([dakaDic[@"2hgxm"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"护工姓名："),@"content":locationModel.hgxm}];
    }
    if([dakaDic[@"3lxfs"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"联系方式："),@"content":locationModel.galxfs}];
    }
    if([dakaDic[@"4time"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"时间："),@"content":[[MYGlobal share] getdayAndWeek:dakaDic[@"timeType"]]}];
    }
    if([dakaDic[@"5dd"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"地点："),@"content":locationModel.gadd}];
    }
    if([dakaDic[@"6tianqi"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"天气："),@"content":locationModel.tianqi}];
    }
    if([dakaDic[@"7jwd"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"经纬度："),@"content":locationModel.jw}];
    }
    if([dakaDic[@"8beizhu"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"备注："),@"content":locationModel.gabz}];
    }
    UIView *tempView;
    for (int i = 0; i < tempArray.count; i++) {
        UILabel *dayLabel = [[UILabel alloc]init];
        dayLabel.text = tempArray[i][@"content"];
        dayLabel.font = MY_SCALE_RegularFONT(14);
        dayLabel.textColor = UIColor.blackColor;
        dayLabel.numberOfLines = 0;
        dayLabel.lineBreakMode = NSLineBreakByWordWrapping;
        [bgView addSubview:dayLabel];
        [dayLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(90);
            make.right.equalTo(bgView).offset(-10);
            if(tempView){
                make.top.equalTo(tempView.mas_bottom).offset(6);
            }else{
                make.top.equalTo(topImgView.mas_bottom).offset(11);
            }
            
            if(i == tempArray.count - 1){
                make.bottom.mas_equalTo(-10);
            }
        }];

        UILabel *titleLabel = [[UILabel alloc]init];
        titleLabel.text = tempArray[i][@"title"];
        titleLabel.font = MY_SCALE_RegularFONT(14);
        titleLabel.textColor = UIColor.blackColor;
        [bgView addSubview:titleLabel];
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(10);
            make.width.mas_equalTo(80);
            make.centerY.equalTo(dayLabel);
        }];
        [titleLabel layoutIfNeeded];
        [titleLabel textAlignmentLeftAndRight];
        tempView = dayLabel;
    }
    [bgView layoutIfNeeded];
    
    UIImage *imageRet = [[UIImage alloc]init];
    DLog(@"wwwww====%f  %f",bgView.width,bgView.height);
    UIGraphicsBeginImageContextWithOptions(bgView.size,NO, 0.0);

    [bgView.layer renderInContext:UIGraphicsGetCurrentContext()];

    imageRet =UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();
    [bgView removeFromSuperview];
    return imageRet;
}

-(UIImage *)lvyoudaka{
    
    UIView *bgView = [UIView new];
    bgView.layer.cornerRadius = 10;
    bgView.clipsToBounds = YES;
    bgView.backgroundColor = UIColor.clearColor;
    [[UIApplication sharedApplication].delegate.window addSubview:bgView];
    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.mas_equalTo(50);
        make.width.mas_equalTo(230);
    }];
    
    UIView *tempBgView = [UIView new];
    tempBgView.backgroundColor = MyColorAlpha(@"#ffffff", 1);
    tempBgView.layer.cornerRadius = 10;
    [bgView addSubview:tempBgView];
    [tempBgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.equalTo(bgView);
        make.top.equalTo(bgView).offset(50);
    }];
    
    UIImageView *topImgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"h_shuiyin_lydk_logo"]];
    [bgView addSubview:topImgView];
    [topImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.right.equalTo(bgView);
        make.height.mas_equalTo(82);
    }];
    UILabel *topTitleLabel = [[UILabel alloc]init];
    topTitleLabel.text = LocalizedString(@"旅游打卡");
    topTitleLabel.font = MY_SCALE_SemiboldFONT(23);
    topTitleLabel.textColor = UIColor.whiteColor;
    [topImgView addSubview:topTitleLabel];
    [topTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(topImgView).offset(-25);
        make.bottom.equalTo(topImgView).offset(-6);
    }];
    
    LocationModel *locationModel = [GetLocation sharedManager].model;
    NSMutableArray *tempArray = [NSMutableArray new];
    NSDictionary *dakaDic = [MYGlobal share].shuiyinDic[LVYOUTYPE];
    
//    lydkDic[@"1tianqi"] = @"1";
//    lydkDic[@"2jdmc"] = @"1";
//    lydkDic[@"3ylry"] = @"0";
//    lydkDic[@"4ylrs"] = @"0";
//    lydkDic[@"5time"] = @"1";
//    lydkDic[@"6add"] = @"1";
//    lydkDic[@"7jwd"] = @"1";
//    lydkDic[@"8beizhu"] = @"0";
    if([dakaDic[@"1tianqi"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"天气："),@"content":locationModel.tianqi}];
    }
    if([dakaDic[@"2jdmc"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"景点名称："),@"content":locationModel.jdmc}];
    }
    if([dakaDic[@"3ylry"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"游览人员："),@"content":locationModel.lyry}];
    }
    if([dakaDic[@"4ylrs"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"游览人数："),@"content":locationModel.lyrs}];
    }
    if([dakaDic[@"5time"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"时间："),@"content":[[MYGlobal share] getdayAndWeek:dakaDic[@"timeType"]]}];
    }
    if([dakaDic[@"6add"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"地点："),@"content":locationModel.lydd}];
    }
    if([dakaDic[@"7jwd"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"经纬度："),@"content":locationModel.jw}];
    }
    if([dakaDic[@"8beizhu"] intValue] == 1){
        [tempArray addObject:@{@"title":LocalizedString(@"备注："),@"content":locationModel.lybz}];
    }
    UIView *tempView;
    for (int i = 0; i < tempArray.count; i++) {
        UILabel *dayLabel = [[UILabel alloc]init];
        dayLabel.text = tempArray[i][@"content"];
        dayLabel.font = MY_SCALE_RegularFONT(14);
        dayLabel.textColor = UIColor.blackColor;
        dayLabel.numberOfLines = 0;
        dayLabel.lineBreakMode = NSLineBreakByWordWrapping;
        [bgView addSubview:dayLabel];
        [dayLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(90);
            make.right.equalTo(bgView).offset(-10);
            if(tempView){
                make.top.equalTo(tempView.mas_bottom).offset(6);
            }else{
                make.top.equalTo(topImgView.mas_bottom).offset(13);
            }
            
            if(i == tempArray.count - 1){
                make.bottom.mas_equalTo(-10);
            }
        }];

        UILabel *titleLabel = [[UILabel alloc]init];
        titleLabel.text = tempArray[i][@"title"];
        titleLabel.numberOfLines = 0;
        titleLabel.lineBreakMode = NSLineBreakByWordWrapping;
        titleLabel.font = MY_SCALE_RegularFONT(14);
        titleLabel.textColor = UIColor.blackColor;
        [bgView addSubview:titleLabel];
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(10);
            make.width.mas_equalTo(80);
            make.centerY.equalTo(dayLabel);
        }];
        [titleLabel layoutIfNeeded];
        [titleLabel textAlignmentLeftAndRight];
        tempView = dayLabel;
    }
    [bgView layoutIfNeeded];
    
    UIImage *imageRet = [[UIImage alloc]init];
    DLog(@"wwwww====%f  %f",bgView.width,bgView.height);
    UIGraphicsBeginImageContextWithOptions(bgView.size,NO, 0.0);

    [bgView.layer renderInContext:UIGraphicsGetCurrentContext()];

    imageRet =UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();
    [bgView removeFromSuperview];
    return imageRet;
}
@end
